package com.ruoyi.system.api.domain.store;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.system.api.domain.basedata.GoodUnit;
import com.ruoyi.system.api.domain.basedata.Goods;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 库存信息对象 finer_warehouse_goods
 *
 * @author wl
 * @date 2024-10-25
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WarehouseGoods implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 搜索值
     */
    @JsonIgnore
    private String searchValue;

    /**
     * 主键id
     */
    private Integer id;

    /**
     * 商品id
     */
    private Integer goodsId;
    private Integer typeId;
    //商品对象
    private Goods goods;

    /**
     * 商品编码
     */
    @Excel(name = "商品编码")
    private String proCode;

    /**
     * 商品名称
     */
    @Excel(name = "商品名称")
    private String proName;

    /**
     * 商品单价
     */
    @Excel(name = "商品单价")
    private BigDecimal price;

    /**
     * 仓库id
     */
    private Integer houseId;

    //仓库对象
    private Warehouse warehouse;

    //仓库编码
    @Excel(name = "仓库编码")
    private String houseCode;

    /**
     * 仓库名称
     */
    @Excel(name = "仓库名称")
    private String houseName;

    //商品单位
    @Excel(name = "单位名称")
    private String unitName;

    //商品单位对象
    private GoodUnit goodUnit;

    /**
     * 库存数量
     */
    @Excel(name = "库存数量")
    private Integer stock;

    /**
     * 金额
     */
    @Excel(name = "总价")
    private BigDecimal priceAll;

    /**
     * 预警值
     */
    @Excel(name = "预警值")
    private Integer stockWaring;

    @Excel(name = "创建人")
    private String createBy;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createDate;

    /**
     * 修改人
     */
    @Excel(name = "修改人")
    private String modifyBy;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date modifyDate;

    /**
     * 备注
     */
    @Excel(name = "备注")
    private String remark;

    /**
     * 0：未删除1：已删除
     */
    private Integer isDel;

    /**
     * 请求参数
     */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Map<String, Object> params;

    public Map<String, Object> getParams() {
        if (params == null) {
            params = new HashMap<>();
        }
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }
}
